package com.fanyouzhao.eshop.core.pojo;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Cleanup;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.mongodb.core.mapping.Field;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;

/**
 * @author: fanyouzhao
 * @date: 15:46 2021/7/2
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel("商品Goods实体类")
@Table(name = "tb_goods")
public class Goods implements Serializable {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "goods_id")
    @ApiModelProperty(value = "id", example = "1")
    private Long id;
    @Column(name = "goods_title")
    @ApiModelProperty(value = "商品标题", example = "***")
    private String title;
    @Column(name = "goods_price")
    @ApiModelProperty(value = "价格", example = "19.99")
    private Double price;
    @Column(name = "goods_created")
    @JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss")
    @ApiModelProperty(value = "创建时间")
    private Date created;
    @Column(name = "status")
    @ApiModelProperty(value = "商品状态")
    private Integer status;
    @Column(name = "goods_num")
    @ApiModelProperty(value = "商品库存数量")
    private Integer num;
}
